home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
dgsay.exe
/
lha
/
DGINIT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-06-29
|
28KB
|
972 lines
{
╔═════════════════════════════════════════════════════════════════════════╗
║ ║
║ TITLE : DGINIT.TPU, Version 8906.01 ║
║ PURPOSE : Various wheels. Don't reinvent. ║
║ AUTHOR : David Gerrold, CompuServe ID: 70307,544 ║
║ _____________________________________________________________________ ║
║ ║
║ This is not public domain software. This is shareware. ║
║ This software is copyright 1989, by David Gerrold. ║
║ ║
║ The Brass Cannon Corporation ║
║ 9420 Reseda Blvd., #804 ║
║ Northridge, CA 91324-2932. ║
║ ║
║ If you find this code useful, a donation of $25 is requested -- ║
║ not to me, but to the AIDS Project Los Angeles. Donations may ║
║ be forwarded via the Brass Cannon address. Thank you. ║
║ ║
╚═════════════════════════════════════════════════════════════════════════╝
}
{ ========================================================================= }
{ Compiler Directives : }
{ ========================================================================= }
{$R-} {Range checking off}
{$B+} {Boolean complete evaluation on}
{$S+} {Stack checking on}
{$I+} {I/O checking on}
{$N+,E+} {Simulate numeric coprocessor}
{$M 65500,16384,655360} {Turbo 3 default stack and heap}
{$V-} {Variable range checking off}
{ ========================================================================= }
{ ========================================================================= }
UNIT DGinit;
{ includes time and date functions }
{ ========================================================================= }
INTERFACE
{ ========================================================================= }
USES
Dos, { TP5.5 unit }
TpDos, { Turbo Professional unit }
TpCrt, { Turbo Professional unit }
TpString, { Turbo Professional unit }
TpWindow; { Turbo Professional unit }
{ ========================================================================= }
TYPE
String2 = string [2];
String3 = string [3];
String6 = string [6];
String12 = string [12];
String25 = string [25];
String80 = string [80];
LocOb = Object
Row, Col : byte;
Procedure AcceptLoc (R, C : byte);
Procedure ReportLoc (Var R, C : byte);
Procedure GotoRC;
end;
TimeOb = Object
Hour,
Minute,
Second,
Sec100 : word;
Function PcTime : String12; { '10:36:09 pm' }
Function ShortTime : String6; { '9:07p' }
end;
DateOb = Object (TimeOb)
Year,
Month,
Day,
DayOfWeek : word;
Function LeapYear : boolean; { returns true if leap year }
Function ValidDate : boolean; { returns true if valid date }
Function GetDayOfWeek : word; { returns day of week }
Function DayOfTheWeek3 : String3; { returns 'Tue' }
Function DayOfTheWeek : String12; { returns 'Tuesday' }
Procedure GetToday; { put today's date in }
{ DateOb variables }
Procedure AcceptDate (Y, M, D : word); { accept user variables }
Procedure AdvanceDate; { advances date one day }
Function PcDate : String12; { ' 3-05-88' }
Function LogDate : String12; { ' 5-Mar-88' }
Function StarDate : String12; { '8803.05' }
Function FormalDate : String25; { 'March 5, 1988' }
Function AbbrevDate : String25; { 'Tue, 3-05-88' }
Function FullDate : String25; { 'Tuesday, March 5, 1988' }
Function TimeStamp : String25; { 'Tue, 12-23-86, 11:01p' }
end;
CONST
Yes = True;
No = False;
On = True;
Off = False;
SoundFlag : Boolean = True;
MusicFlag : Boolean = True;
ClickFlag : Boolean = True;
ClockFlag : Boolean = False;
SingleLine = #218#192#191#217#196#179;
DoubleLine = #201#200#187#188#205#186;
Blinking : byte = 128;
BlackBlack = $00;
BlueBlack = $01;
GreenBlack = $02;
CyanBlack = $03;
RedBlack = $04;
MagentaBlack = $05;
BrownBlack = $06;
LightGrayBlack = $07;
DarkGrayBlack = $08;
LightBlueBlack = $09;
LightGreenBlack = $0A;
LightCyanBlack = $0B;
LightRedBlack = $0C;
LightMagentaBlack = $0D;
YellowBlack = $0E;
WhiteBlack = $0F;
BlackBlue = $10;
BlueBlue = $11;
GreenBlue = $12;
CyanBlue = $13;
RedBlue = $14;
MagentaBlue = $15;
BrownBlue = $16;
LightGrayBlue = $17; DarkGrayBlue = $18;
LightBlueBlue = $19;
LightGreenBlue = $1A;
LightCyanBlue = $1B;
LightRedBlue = $1C;
LightMagentaBlue = $1D;
YellowBlue = $1E;
WhiteBlue = $1F;
BlackGreen = $20;
BlueGreen = $21;
GreenGreen = $22;
CyanGreen = $23;
RedGreen = $24;
MagentaGreen = $25;
BrownGreen = $26;
LightGrayGreen = $27;
DarkGrayGreen = $28;
LightBlueGreen = $29;
LightGreenGreen = $2A;
LightCyanGreen = $2B;
LightRedGreen = $2C;
LightMagentaGreen = $2D;
YellowGreen = $2E;
WhiteGreen = $2F;
BlackCyan = $30;
BlueCyan = $31;
GreenCyan = $32;
CyanCyan = $33;
RedCyan = $34;
MagentaCyan = $35;
BrownCyan = $36;
LightGrayCyan = $37;
DarkGrayCyan = $38;
LightBlueCyan = $39;
LightGreenCyan = $3A;
LightCyanCyan = $3B;
LightRedCyan = $3C;
LightMagentaCyan = $3D;
YellowCyan = $3E;
WhiteCyan = $3F;
BlackRed = $40;
BlueRed = $41;
GreenRed = $42;
CyanRed = $43;
RedRed = $44;
MagentaRed = $45;
BrownRed = $46;
LightGrayRed = $47;
DarkGrayRed = $48;
LightBlueRed = $49;
LightGreenRed = $4A;
LightCyanRed = $4B;
LightRedRed = $4C;
LightMagentaRed = $4D;
YellowRed = $4E;
WhiteRed = $4F;
BlackMagenta = $50;
BlueMagenta = $51;
GreenMagenta = $52;
CyanMagenta = $53;
RedMagenta = $54;
MagentaMagenta = $55;
BrownMagenta = $56;
LightGrayMagenta = $57;
DarkGrayMagenta = $58;
LightBlueMagenta = $59;
LightGreenMagenta = $5A;
LightCyanMagenta = $5B;
LightRedMagenta = $5C;
LightMagentaMagenta = $5D;
YellowMagenta = $5E;
WhiteMagenta = $5F;
BlackBrown = $60;
BlueBrown